//
//  EnumDefinition.h
//  Chart
//
//  Created by caojun on 14/11/5.
//
//

#ifndef __Chart__EnumDefinition__
#define __Chart__EnumDefinition__

#include <string>

namespace ytx{
    namespace QuotationType{
        //ADDIndex: 下方的报价类型
        enum QuotationType{
            AVG = 0,KLine,Volume,MACD,KDJ,RSI,BIAS,MA,BOLLIN,TJ,EconomicCalendar, QK, QKT, CCI, GameMatrix, HJJT, Tuov
        };
    }

    namespace IndexChartType{
        enum IndexChartType{
            main = 0,
            minor,
            EMPTY = 100
        };
    }

    namespace IndexType{
        //ADDIndex: 指标
        enum IndexType{
            QK = 0, QKT, GameMatrix, HJJT, HJJTZX, HJJTGJ, HJJTJC, TJ, MA, BOLLIN, EconomicCalendar, VOLUME, Tuov, MACD, KDJ, RSI, BIAS, CCI, LSP, EMPTY = 1000
        };

        std::string ConvertIndexTypeToString(const IndexType);
        IndexType ConvertIndexTypeFromString(const std::string);
    }

    const static unsigned int IndexChartViewTypeNone = 0;
    const static unsigned int IndexChartViewTypeAVG = 1 << 0;
    const static unsigned int IndexChartViewTypeKLine = 1 << 1;

    namespace ChartPosition{
        enum ChartPosition{
            left_top,
            right_top,
            right_bottom,
            left_bottom
        };
    }

    namespace LineType{
        enum LineType{
            LAVG = 0,
//            LAVG2,
//            LAVG5,
//            L1m,
            L5m,
            L15m,
            L30m,
            L60m,
//            L120m,
//            L180m,
//            L240m,
            L1d,
            L1w,
//            L1M,
//            LSP,
            EMPTY
        };

        std::string convertLineTypeToString(const LineType ltype);

        LineType convertLineTypeFromString(const std::string ltype);

        bool isMinuteLine(const LineType ltype);
        
        bool isMinutekLine(const LineType ltype);

        bool isKLine(const LineType ltype);

        int getRequestParamOfQuotationType(const LineType ltype);

        int getRequestParamOfQuotationTypeMinute(const LineType ltype);
    }

}

#endif /* defined(__Chart__EnumDefinition__) */
